package eight.test_8_31;

import java.util.Map;
import java.util.Scanner;

public class TestMain2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[][] matrix = new int[2][n];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < n; j++) {
                matrix[i][j] = scanner.nextInt();
            }
        }
        int[][] dp = new int[2][n];
        int cost = findPathCost(matrix,dp);
        System.out.println(cost);
    }
    private  static  int findPathCost(int[][] matrix,int[][] dp) {
        int n = matrix[0].length;
        dp[0][n - 1] = matrix[0][n - 1];
        dp[1][n - 1] = matrix[1][n - 1];
        for (int j = n - 2; j >= 0; j--) {
            dp[0][j] = matrix[0][j] + Math.max(dp[0][j + 1],dp[1][j + 1]);
            dp[1][j] = matrix[1][j] + Math.min(dp[0][j + 1],dp[1][j + 1]);
        }
        return Math.max(dp[1][0],dp[0][0]);
    }
}
